# ifndef __ShpExtraLoader_H_
# define __ShpExtraLoader_H_

# include "Map.h"
# include "ShpWizard.h"

class CDatabaseTable;
class CShpWizard;

class CShpExtraLoader {
  public:
	void Bind (CShpWizard * _pWizard, const CDatabaseTable * _pDbt, map_t * _pMap);

	struct extra_t {
		string_t strComment;
		size_t   cEndLevel;

		string_t strNumber;
		string_t strStreet;
		city_t * pCity;
		zip_t  * pZip;

		string_t strPhone;
		string_t strFax;
		string_t strEmail;
		string_t strWebPage;
		string_t strDescription;

		bool bDirIndicator;

		BYTE fSpeedLimit;
		BYTE fRouteClass;
		bool bOneWay;
		bool bToll;
		bool bNoEmergency;
		bool bNoDelivery;
		bool bNoCar;
		bool bNoBus;
		bool bNoTaxi;
		bool bNoPedestrian;
		bool bNoBicycle;
		bool bNoTruck;
	};

	void ReadExtra (size_t _cRecordCounter, extra_t & _extra);
	void SetRgnExtraAttributes (rgn_t & _rgn, extra_t & _extra);

  private:
	CShpWizard * m_pWizard;
	const CDatabaseTable * m_pDbt;
	map_t * m_pMap;

	int  _GetInt    (size_t _cRecordCounter, input_attr_t _ia) const;
	bool _GetBool   (size_t _cRecordCounter, input_attr_t _ia) const;
	void _GetString (size_t _cRecordCounter, input_attr_t _ia, string_t & _str) const;

	typedef std::map<string_t, city_t *> name2city_t;
	name2city_t m_name2city;
	city_t * GetCity (size_t _cRecordCounter);

	typedef std::map<string_t, zip_t  *> name2zip_t;
	name2zip_t  m_name2zip;
	zip_t  * GetZip  (size_t _cRecordCounter);
};

# endif // __ShpExtraLoader_H_